import base from './base'; // 导入接口域名列表
import axios from './http'; // 导入http中创建的axios实例
const apiUrl = base.test;
// 导出接口
export default {
  //获取商品详情
  getGoodsDetail (goodsId) {
    return axios.get(`${apiUrl}/nu/goods/${goodsId}`);
  },
  //获取商品评论
  getGoodsComment (goodsId) {
    return axios.get(`${apiUrl}/nu/evaluation/${goodsId}/list`)
  },
  // 获取商品分页列表
  getGoodsList (currentPage, pageSize) {
    return axios.get(`${apiUrl}/nu/goods/list`, {
      currentPage,pageSize
    })
  },
  //产品验证
  goodsVerify (qrcode, verificationCode) {
    return axios.get(`${apiUrl}/nu/box/code/check?qrcode=${qrcode}&verificationCode=${verificationCode}`)
  },
  // 评论订单商品
  postOrderComment (params) {
    const { orderId } = params;
    return axios.post(`${apiUrl}/nu/client/evaluation/${orderId}`, params);
  }
}

